package cn.tedu.controller;


import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.tedu.entity.News;
import cn.tedu.entity.NewsType;
import cn.tedu.service.NewsService;
import cn.tedu.service.NewsTypeService;
import cn.tedu.service.impl.NewsServiceImpl;
import cn.tedu.service.impl.NewsTypeServiceImpl;
/**
 * 首页最新基地动态
 * @author waqwb
 *
 */
public class NewsTypeServlet extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		System.out.println("NewsTypeServlet!!!");
		response.setContentType("text/html;charset=utf-8");
		/**
		 * 新闻
		 */
		/*NewsService newsService = new NewsServiceImpl();
		List<News> newsList = newsService.getNewsList();
		request.setAttribute("newsList",newsList );*/
		/**
		 * 动态
		 */
		NewsTypeService newsTypeService = new NewsTypeServiceImpl();
		List<NewsType> listNewsType = newsTypeService.getAllNewsType();
		request.setAttribute("listNewsType",listNewsType );
		
		request.getRequestDispatcher("index.jsp").forward(request, response);
		
	}
}
